<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=UTF-8" %>

<jsp:useBean id="user" class="model.User" scope="session" />
<jsp:useBean id="change" class="java.lang.String" scope="session" />
<jsp:useBean id="povl" class="model.Povlastica" scope="session" />

<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<title>Prijavljivanje</title>
</head>
<body>
<h1>Dodavanje nove povlastice</h1>

<%
	if (user != null && user.isLoggedIn()) {
%>
<form action="/benefits" method="get">
<table>
	<tr>
		<td align=right>Naziv:</td>
		<td><input type="text" name="naziv"></td>
	</tr>
	<tr>
		<td align=right vAlign= top>Tip:<br>(Izaberite jednu)</td>
		<td><select name="op" size="2">
			<option value="1">Procenat</option>
			<option value="2">Iznos (din.)</option>
		</select></td>
	</tr>
	<tr>
		<td align=right>Vrednost tipa:</td>
		<td><input type="text" name="vrednost"></td>
	</tr>
	<tr>
		<td align=right vAlign= top>Kategorija:
		<br>(Izaberite jednu )</td>
		<td><select name="kat" size="5">
			<c:forEach var="benCat" items="${sessionScope.allBenCats}">			   			
				<option value="${benCat.sifra.id}">${benCat.naziv}</option>
			</c:forEach>
		</select>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><input type="submit" value="Dodaj"></td>
	</tr>
</table>

</form>
<%
	} else {
%>
<p>Niste se prijavili! <br>
<a href="/logIn">Prijavi se</a></p>
<%
	}
%>

<p><a href="/timeTableServlet">Red voznje</a> <br>
<a href="/logIn?logOff=true">Odjava</a></p>

</body>
</html>
